import iconList from '@/config/iconList'
export const optionParent = {
  lazy: true,
  tip: false,
  simplePage: true,
  searchShow: true,
  searchMenuSpan: 6,
  dialogType: 'drawer',
  dialogWidth: '70%',
  tree: true,
  border: true,
  index: true,
  selection: true,
  viewBtn: false,
  editBtn: false,
  addBtn: false,
  delBtn: false,
  dialogClickModal: false,
  align: 'center',
  column: [
    {
      label: '菜单名称',
      prop: 'name',
      search: true,
      align: 'left',
      headerAlign: 'center',
      rules: [
        {
          required: true,
          message: '请输入菜单名称',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '路由地址',
      prop: 'path',
      rules: [
        {
          required: true,
          message: '请输入路由地址',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '上级菜单',
      prop: 'parentId',
      type: 'tree',
      dicUrl: '/api/blade-system/menu/tree',
      hide: true,
      props: {
        label: 'title'
      },
      rules: [
        {
          required: false,
          message: '请选择上级菜单',
          trigger: 'click'
        }
      ]
    },
    {
      label: '菜单图标',
      prop: 'source',
      type: 'icon',
      slot: true,
      width: 80,
      iconList: iconList,
      rules: [
        {
          required: true,
          message: '请输入菜单图标',
          trigger: 'click'
        }
      ]
    },
    {
      label: '菜单编号',
      prop: 'code',
      search: true,
      rules: [
        {
          required: true,
          message: '请输入菜单编号',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '菜单类型',
      prop: 'category',
      type: 'radio',
      dicData: [
        {
          label: '菜单',
          value: 1
        },
        {
          label: '按钮',
          value: 2
        }
      ],
      hide: true,
      rules: [
        {
          required: true,
          message: '请选择菜单类型',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '菜单别名',
      prop: 'alias',
      rules: [
        {
          required: true,
          message: '请输入菜单别名',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '按钮功能',
      prop: 'action',
      type: 'radio',
      dicData: [
        {
          label: '工具栏',
          value: 0
        },
        {
          label: '操作栏',
          value: 1
        },
        {
          label: '工具操作栏',
          value: 2
        }
      ],
      hide: true,
      rules: [
        {
          required: true,
          message: '请选择按钮功能',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '菜单排序',
      prop: 'sort',
      type: 'number',
      width: 80,
      rules: [
        {
          required: true,
          message: '请输入菜单排序',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '新窗口',
      prop: 'isOpen',
      type: 'radio',
      dicData: [
        {
          label: '否',
          value: 0
        },
        {
          label: '是',
          value: 1
        }
      ],
      hide: true
    },
    {
      label: '菜单备注',
      prop: 'remark',
      type: 'textarea',
      span: 24,
      minRows: 6,
      hide: true
    }
  ]
}

export const optionChild = {
  tip: false,
  searchShow: true,
  searchMenuSpan: 6,
  border: true,
  index: true,
  viewBtn: true,
  selection: true,
  menuWidth: 200,
  dialogType: 'drawer',
  dialogWidth: '70%',
  dialogClickModal: false,
  align: 'center',
  column: [
    {
      label: '权限名称',
      prop: 'scopeName',
      search: true,
      value: '',
      rules: [
        {
          required: true,
          message: '请输入数据权限名称',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '权限编号',
      prop: 'resourceCode',
      search: true,
      width: 100,
      rules: [
        {
          required: true,
          message: '请输入数据权限编号',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '权限字段',
      prop: 'scopeColumn',
      width: 130,
      rules: [
        {
          required: true,
          message: '请输入数据权限编号',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '规则类型',
      type: 'select',
      dicUrl: '/api/blade-system/dict/dictionary?code=data_scope_type',
      props: {
        label: 'dictValue',
        value: 'dictKey'
      },
      dataType: 'number',
      slot: true,
      width: 140,
      prop: 'scopeType',
      rules: [
        {
          required: true,
          message: '请输入通知类型',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '可见字段',
      prop: 'scopeField',
      span: 24,
      hide: true,
      value: '*',
      rules: [
        {
          required: true,
          message: '请输入数据权限可见的字段',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '权限类名',
      prop: 'scopeClass',
      span: 24,
      hide: true,
      rules: [
        {
          required: true,
          message: '请输入MybatisMapper对应方法的完整类名路径',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '规则值',
      prop: 'scopeValue',
      span: 24,
      minRows: 5,
      type: 'textarea',
      display: true,
      hide: true
    },
    {
      label: '备注',
      prop: 'remark',
      span: 24,
      hide: true
    }
  ]
}
